
// 顶部导航栏点击效果
const topNavItems = document.querySelectorAll('.top-nav-item');
topNavItems.forEach(item => {
  item.addEventListener('click', function () {
    topNavItems.forEach(i => i.classList.remove('active'));
    this.classList.add('active');
  });
});

// 左侧导航栏点击效果
const leftNavItems = document.querySelectorAll('.left-nav-item');
leftNavItems.forEach(item => {
  item.addEventListener('click', function () {
    leftNavItems.forEach(i => i.classList.remove('active'));
    this.classList.add('active');
  });
});

// 收起左侧导航栏
const collapseBtn = document.querySelector('.collapse-btn');
const leftNav = document.querySelector('.left-nav');
collapseBtn.addEventListener('click', function () {
  leftNav.classList.toggle('collapsed');
});

// 发布按钮点击事件
const content = document.querySelector('.content')
const add = document.querySelector('add')
const publishBtn = document.querySelector('.publish-btn');
const taskInput = document.querySelector('.task-input');
publishBtn.addEventListener('click', function () {
  if (taskInput.value.trim() !== '') {
    alert('任务已发布: ' + taskInput.value);
    content.innerHTML = '任务列表:' + taskInput.value;
    taskInput.value = '';
  } else {
    alert('请输入任务内容');
  }
});

// 导出按钮点击事件
const exportBtn = document.querySelector('.export-btn');
exportBtn.addEventListener('click', function () {
  alert('任务数据已导出');
});